package com.demo.thymeleafdemo.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author ddone
 * @date 2024/3/12-20:03
 */
@WebServlet("/scopeA")
public class ScopeAServlet extends ViewBaseServlet{
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req,resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setAttribute("requestMsg","request数据");
        req.getSession().setAttribute("sessionMsg","session数据");
        req.getServletContext().setAttribute("contextMsg","context数据");
        this.processTemplate("scope",req,resp);
    }
}
